<?php
session_start();
include "Includes/solotrn_sesion.php";
include "Includes/soloFun_Generales.php";

$opcionT = $_REQUEST["opcionT"];
$CboArea = $_REQUEST["CboArea"];
//echo $CboArea;
$Titulo = "B&uacute;squeda de Personal";
$SoloSQL = "select c.co_usua as codigo, c.no_usua as nombre from tb_soporte a left join solotb_usuario c on a.nu_usua = c.nu_usua where cod_dpto = $CboArea order by nombre";
//$SoloSQL = "SELECT codigo, nombre FROM tb_soporte left join solotb_nivel2 on administrador = co_supervisor where id2 = $CboArea and estado= 'A' ";
//echo $soloSQL;
$txtCodigo = $_REQUEST["txtCodigo"];

//'rw"",txtCodigo
if ($txtCodigo <> "")
    $SoloSQL .= " and nombre like '%" .  $_REQUEST["txtCodigo"] . "%'";

//echo $SoloSQL;

SoloFun_ExecSql ($SoloSQL,$SoloArreglo);
?>
<html>
    <head>
        <title>B&uacute;squeda R&aacute;pida</title>
        <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
        <link href="SoloStyles/Solostyles.css" rel="stylesheet" type="text/css">
        <SCRIPT type="text/JavaScript" src="Includes/Solofun_generales.js"></SCRIPT>
        <script type="text/JavaScript">

            function SoloFun_RetornaValores(op,v1,v2)
            {
                //alert(op);
                if (op==0)
                {
                    window.opener.document.all.xtxtTecnicoUser1.value= v1;
                    window.opener.document.all.xtxtTecnicoUser1Hid.value= v1;
                    window.opener.document.all.xtxtTecnicoNombre1.value= v2;
                }
                if (op==1)
                {
                    window.opener.document.all.xtxtTecnicoUser2.value= v1;
                    window.opener.document.all.xtxtTecnicoUser2Hid.value= v1;
                    window.opener.document.all.xtxtTecnicoNombre2.value= v2;
                }
                if (op==2)
                {
                    window.opener.document.all.xtxtTecnicoUser3.value= v1;
                    window.opener.document.all.xtxtTecnicoUser3Hid.value= v1;
                    window.opener.document.all.xtxtTecnicoNombre3.value= v2;
                }

                window.close();
            }
        </script>
    </head>
    <body topmargin="0" leftmargin="0" onkeydown="checkKey();">
        <br>
        <p align="center" class="SoloStyle_TituloPaginas"><?php echo $Titulo;?></p>
        <form name="frm" action="solotrn_Soporte.php" method="POST">



            <table border="0" width="90%" align="center" cellpadding="2" cellspacing="1" bordercolor="#CCCCCC">
                <tr>
                    <td>
                        <!--<img src="iconos/soloico_Nuevo.gif" border="1" alt="Ingresar Nuevo Registro" style="cursor:hand" onClick="javascript:location.href='solotrn_Localidades.asp?Opcion=<?php //'=$_REQUEST["Opcion")?>';" >-->
                        <img src="iconos/soloico_consultar.gif" border="1" alt="Buscar" style="cursor:hand" onClick="document.frm.submit();">
                        <input type="hidden" name="opcionT" value="<?php echo $opcionT;?>">
                        <input type="hidden" name="CboArea" value="<?php echo $CboArea;?>">
                    </td>
            </table>
            <table border=1 width="90%" align="center" cellpadding="2" cellspacing="1" bordercolor="#CCCCCC">
                <tr>
                    <td class="SoloStyle_Etiqueta">Criterio </td>
                    <td class="SoloStyle_EtiquetaCajas">
                        <input name="txtCodigo" type="text" class="SoloStyle_Texto"  size="30" maxlength="50" maxlenght="14">
                    </td>
                </tr>
            </table>
        </form>

        <table width="90%" border="1" cellpadding="0" cellspacing="1" align="center" bordercolor="#CCCCCC">
            <tr class="SoloStyle_Etiqueta">
                <td width="10%" height="20">Id</td>
                <td width="90%">Descripci&oacute;n</td>
            </tr>
            <?php
            $CL_FILAS = count($SoloArreglo);
            //'rw "",CL_Filas
            //'re
            for ($i = 0; $i < $CL_FILAS; $i++) {
                $clase = "SoloStyle_Texto";
                if (($i%2)==0)     $clase = "SoloStyle_Grid";?>
            <tr class="<?php echo $clase;?>">
                    <?php if ($opcion <> "6") {?>
                <td><?php echo $SoloArreglo[$i][0];?></td>
                <td>
                    <a href="javascript:SoloFun_RetornaValores('<?php echo $_REQUEST["opcionT"];?>','<?php echo $SoloArreglo[$i][0];?>','<?php echo $SoloArreglo[$i][1];?>');"><?php echo $SoloArreglo[$i][1];?></a>
                            <?php }else {?>
                <td><?php echo $SoloArreglo[$i][0];?></td>
                <td><?php echo $SoloArreglo[$i][2];?></td>
                <td><?php echo $SoloArreglo[$i][3];?></td>
                        <?php }?>
            </tr>
                <?php  }?>
        </table>

        <br>
    </body>
</html>
<?php
include "Includes/soloFun_ShowMessages.php";
?>
